package day04;

import java.util.Scanner;

public class test12 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份：");
        int y = sc.nextInt();
        System.out.println("请输入月份：");
        int m = sc.nextInt();
        if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {
            if (m == 2) {
                System.out.println("29");
            } else if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
                System.out.println("31");
            } else {
                System.out.println("30");
            }
        } else {
            if (m == 2) {
                System.out.println("28");
            } else if (m == 4 || m == 6 || m == 9 || m == 11) {
                System.out.println("30");
            } else {
                System.out.println("31");
            }
        }
    }
}
